package com.ytf.test.seventh;

/**
 * @author: YTF
 * @date: 2024/11/6 16:38
 * @version: 1.0
 * @description: 向上转型 注意使用方法
 */
public class Wind extends Instrument{
    public static void main(String[] args) {
        Wind wind = new Wind();
        // wind.play();
        Instrument.tune(wind);
        /**
         * Output:
         *  Instrument.olay()
         */
    }
}

class Instrument{
    public void play(){
        System.out.println("Instrument.play()");
    }
    static void tune(Instrument instrument){
        instrument.play();
    }
}
